﻿using System.Threading.Tasks;
using Zdap.Common;

namespace Zdap.XCode.Service
{
    /// <summary>
    /// 查询数据
    /// </summary>
    /// <typeparam name="TDto"></typeparam>
    public interface ISearchServiceBase<TDto> where TDto : class
    {
        #region 数据获取

        /// <summary>
        /// 是否启用 允许无参数，查询整个表的数据,默认：false
        /// </summary>
        bool EnableAllowNoParameter { get; }

        /// <summary>
        /// 搜索数据集
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        Task<PageResponseContext<TDto>> Search(Pager p);

        ///// <summary>
        ///// </summary>
        ///// <param name="p"></param>
        ///// <returns></returns>
        //Task<PageResponseContext2<TDto>> SearchAsync(Pager p);

        /// <summary>
        /// 搜索列表前端自定查询字段,多个字段自动拼接成AND查询
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        Task<ListResponseContext<TDto>> SearchAll(RequestParameter p);

        ///// <summary>
        ///// 数据搜索，自定义查询字段,多个字段自动拼接成AND查询
        ///// </summary>
        ///// <param name="p"></param>
        ///// <returns></returns>
        //Task<List<TDto>> SearchByParams(RequestParameter p);

        ///// <summary>
        ///// 搜索列表前端自定查询字段,多个字段自动拼接成AND查询
        ///// </summary>
        ///// <param name="p"></param>
        ///// <returns></returns>
        //Task<ListResponseContext<TDto>> SearchBy(RequestParameter<TDto> p);

        ///// <summary>
        ///// 查找所有数据
        ///// </summary>
        ///// <returns></returns>
        //Task<ListResponseContext<TDto>> FindAllAsync(IDictionary<string, object> param);

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        ListResponseContext<ColumnDataModel> GetColumnDataModel();

        #endregion 数据获取
    }
}